<?php


class Demo {

    const APP_ID = '123434';
    const APP_KEY = 'asdfds2342342';


    public function sign(array $params = []) {
       $params['app_id'] = self::APP_ID;
       $params['timestamp'] = time();
       ksort($params);
       $params['key'] = self::APP_KEY;

       //获取加密前字符串
       $str = http_build_query($params);
       //加密后转大写
        return strtoupper(md5($str));
    }
}

$params = [
    'phone' => '13888888'
];

$sign = (new Demo)->sign($params);
echo $sign;


